import Vue from 'vue'
import VueRouter from 'vue-router'
import home from '../views/home/home.vue'
import qa from '../views/qa/qa.vue'
import movie from '../views/movie/movie.vue'
import user from '../views/user/user.vue'
import login from '../views/user/login.vue'
import edit from '../views/user/edit.vue'
import notfound from '../views/notfound/notfound.vue'

Vue.use(VueRouter)

const routes = [{
        path: '/home',
        name: 'home',
        component: home,
        meta: { isShow: true }
    },
    {
        path: '/qa',
        name: 'qa',
        component: qa,
        meta: {
            isShow: true
        }
    },
    {
        path: '/login',
        name: 'login',
        component: login
    },
    {
        path: '/movie',
        name: 'movie',
        component: movie,
        meta: {
            isShow: true
        }
    },
    {
        path: '/user',
        name: 'user',
        component: user,
        meta: {
            isShow: true,
            isLoging: true
        }
    },
    {
        path: '/edit',
        name: 'edit',
        component: edit
    },
    {
        path: '/notfound',
        name: 'notfound',
        component: notfound
    },
    {
        path: '/',
        redirect: '/home'
    },
    {
        path: '*',
        redirect: '/notfound'
    }
]

const router = new VueRouter({
    routes
})

export default router